<h3>
	Course Placement List for <?php echo $this->term?>
</h3>
<?php if($this->courses):?>
	<ul>
	<?php foreach($this->courses as $course): ?>
			<li><?php echo $course['COURSENUMBER']?> - <?php echo $course['COURSENAME']?><br/>
				<?php echo $course['TEACHER']['FIRSTNAME']. " ".$course['TEACHER']['LASTNAME'] . " - "?>
				<?php 
					if(!$course['TEACHER']['EMAIL']) 
						echo "(No Email)";
					else 
						echo '<a href=\'mailto:'.$course['TEACHER']['EMAIL'].'\'>'.$course['TEACHER']['EMAIL'].'</a>';
				?>
			
				<ul>
				<?php foreach($course['POSITIONS'] as $pos): ?>
						<li><a href="<?php echo $this->url(array('controller'=>'common','action'=>'viewvrdetails','vrid'=>$pos['RID'])); ?>">
						<?php echo $pos['PARTNER']."-".$pos['POSNAME'] ?></a><br/> 
						Organization Contact:<br/>
						<?php if($pos['CONTACTNAMEFIR']==""):?>
							(No Contact)<br/>
						<?php else: ?>
							<?php 
							$name = $pos['CONTACTNAMEFIR']." ".$pos['CONTACTNAMELAS'];
							if(!$pos['CONTACTNAMEPRE']=="")
								$name = $pos['CONTACTNAMEPRE']." ".$name;
							if(!$pos['CONTACTNAMESUF']=="")
								$name = $name.", ".$pos['CONTATNAMESUF'];
							echo $name
							?>
							<?php 
							$email=($pos['CONTACTEMAIL']=="")?"(No Email)":$pos['CONTACTEMAIL'];
							?><br/>
							<?php if(!$pos['CONTACTPHONE']=="") echo $pos['CONTACTPHONE']."<br/>";?>
							<?php if (!$pos['CONTACTADDR1']==""):?>
								<?php echo $pos['CONTACTADDR1'];?><br/>
								<?php if(!$pos['CONTACTADDR2']=="") echo $pos['CONTACTADDR2']."<br/>";?>
								<?php if(!$pos['CONTACTADDR3']=="") echo $pos['CONTACTADDR3']."<br/>";?>
								<?php echo $pos['CONTACTCITY'].", ".$pos['CONTACTSTATE']." ".$pos['CONTACTZIP']?><br/>		
							<?php endif;?>	
						<?php endif; ?>			
						Positions Granted: <?php echo $pos['GRANTED']?>
						</li>	
				<?php endforeach;?>
				</ul>
			</li>
	<?php endforeach; ?>
	</ul>
<?php endif; ?>
<?php if(!$this->courses):?>
	No courses found for the current term.
<?php endif; ?>


<h5>Other Terms</h5><a href="javascript:void(0)" onclick="minimize(this,'otherTerms')" style = "font-size:80%">Hide</a>
<div id="otherTerms">
<?php foreach($this->otherTerms as $term): ?>
	<a href="<?php echo $this->url(array('controller'=>'report','action'=>'courseplacement','term'=>$term)); ?>"><?php echo $term ?></a>&nbsp;&nbsp;&nbsp;
<?php endforeach?>
<br/><br/>
</div>

<script type="text/javascript">
	function minimize(link,elementName){
		if(link.innerHTML == "Hide"){
			link.innerHTML = "Show";
			document.getElementById(elementName).style.visibility='hidden';
		}else{
			link.innerHTML = "Hide";
			document.getElementById(elementName).style.visibility='visible';
		}
	}
</script>